package org.excilys.training.ebanking.dao;


import org.excilys.training.ebanking.idao.IDaoTypeOperation;
import org.excilys.training.ebanking.model.TypeOperation;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
@Repository(value="typeOperation")
public class DaoTypeOperation extends HibernateDaoSupport implements IDaoTypeOperation{
	@Autowired
	public DaoTypeOperation (SessionFactory sessionFactory){
		setSessionFactory(sessionFactory);
	}
	/**
	 * Methode permettant d'obtenir un type d'operation à partir de son id
	 *
	 * @param idTypeOperation
	 * 							id de l'operation
	 *
	 * @return TypeOperation
	 */
	public TypeOperation getTypeOperation(int idTypeOperation){
		return getHibernateTemplate().get(TypeOperation.class, idTypeOperation);
	}
}
